import cv2

img = cv2.imread(r'D:\baidudownload\photo\531-3+4-8-1.tif', 1)
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imwrite(r'D:\baidudownload\photo\531-3+4-8-1_Gray.png', img_gray)
print(1)